﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Reflection;
using System.Text;
using System.Threading;
using BrainTechLLC.ThreadSafeObjects;
using System.Collections.ObjectModel;

namespace BrainTechLLC
{
    public static class LockingFunctions
    {
        public static void EnterMonitor(this object o, int ms)
        {
            while (!Monitor.TryEnter(o, ms))
            {
                Console.WriteLine("Sleeping 20ms");
                Thread.Sleep(20);
            }
        }
    }
}
